<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <title>角色-菜单分配</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="static/layuiadmin/style/admin.css" media="all">
</head>
    <body>

    <div class="layui-form" lay-filter="layuiadmin-form-role" id="layuiadmin-form-role" style="padding: 20px 30px 0 0;">
        <div class="layui-form-item">
            <label class="layui-form-label">授权菜单的角色</label>
            <div class="layui-input-block" >
                <select name="rolename" id="rolename" lay-filter="selectRole">
                    <%--由js遍历选项option--%>
                </select>
            </div>
        </div>


        <%--遍历所有菜单进行分配--%>
        <div class="layui-form-item">
        <label class="layui-form-label">菜单访问范围</label>
        <div class="layui-card-body">

            <table id="LAY-app-content-list" lay-filter="LAY-app-content-list" >

            </table>

            <script type="text/html" id="buttonTpl">
                {{#  if(d.menuStatus == 1){ }}
                <button class="layui-btn layui-btn-xs" lay-event="available">菜单可用</button>
                {{#  } else { }}
                <button class="layui-btn layui-btn-primary layui-btn-xs" lay-event="forbid">菜单禁用</button>
                {{#  } }}
            </script>


        </div>

        <div class="layui-form-item ">
            <div class="layui-input-block">
                <div class="layui-footer">
                    <button class="layui-btn" lay-submit lay-filter="LAY-user-role-addBTtn" id="LAY-user-role-addBTtn" style="width: 200px "><i class="layui-icon layui-icon-link"></i>为选中的角色添加菜单</button>
                    <button class="layui-btn" lay-submit lay-filter="LAY-user-role-deleteBTtn" id="LAY-user-role-deleteBTtn" style="width: 200px"><i class="layui-icon layui-icon-unlink"></i>为选中的角色解除菜单</button>
                </div>
            </div>
        </div>

            <%--为角色添加菜单的数据表格--%>
            <div class="layui-form-item" style="display:none" id="show-rolemenu-form" lay-filter="show-rolemenu-form">

                <table id="LAY-add-roleMenu-list" lay-filter="LAY-add-roleMenu-list" >

                </table>
                <div class="layui-form-item ">
                    <div class="layui-input-block">
                        <div class="layui-footer">
                            <button class="layui-btn" lay-submit lay-filter="LAY-user-role-add" id="LAY-user-role-add"><i class="layui-icon layui-icon-flag"></i>确定添加</button>
                            <button class="layui-btn" lay-submit lay-filter="LAY-user-role-close" id="LAY-user-role-close"><i class="layui-icon layui-icon-flag"></i>取消</button>
                        </div>
                    </div>
                </div>
            </div>



    </div>
    <script src="static/user/js/jquery.min.js" charset="UTF-8"></script>
    <script src="static/layuiadmin/layui/layui.js" charset="UTF-8"></script>
    <script src="static/user/roleMenu.js" charset="UTF-8"></script>
    </body>
</html>
